type Person = ref object
  n:string

proc name(p:Person):string = p.n

proc `name=`(p: var Person, n: string) =
  p.n = n

var p1=Person(n:"damao")
p1.name="xiaomao"
echo p1.name

